package com.ynhenc.pta.routeRank.impl;

import com.beone.carbonManager.*;
import com.ynhenc.pta.routeRank.TransitType;

public class CarbonCalculator {
	
	private CarbonCalculator() {
		
	}
	
	public double getCarbon_Gram( TransitType transitType , double length_Meter ) { 
		CarbonApi api = new CarbonApi();
		
		return api.getCarbonEmission_Gram( new Sect( transitType.getCode(), length_Meter )); 
	}
	
	public double getCarbonDirect_Gram( TransitType transitType , double length_Meter) { 
		double cabonCoeff = transitType.getCarbonEmissonCoeff();
		double carbon_Gram = length_Meter * cabonCoeff; 

		return carbon_Gram;
	}
	
	private static final CarbonCalculator CARBON_CALCULATOR = new CarbonCalculator();
	
	public static CarbonCalculator getCarbonCalculator() {
		return CarbonCalculator.CARBON_CALCULATOR;
	}

}
